class ApiError extends Error {}

export default function use$apiErr() {
  const throwApiErr = (msg: string) => {
    throw new ApiError(msg);
  };
  const isApiErr = (v: any) => {
    return v && v instanceof ApiError;
  };

  return { throwApiErr, isApiErr };
}
